﻿<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<link rel="stylesheet" href="${pageContext.request.contextPath}/ztree/css/zTreeStyle/zTreeStyle.css" />
<script src="${pageContext.request.contextPath}/jquery/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ztree/js/jquery.ztree.all.min.js" type="text/javascript"></script>

<script type="text/javascript">
		var setting = {
			data: {
				simpleData: {
					enable: true
				}
			},
			callback:{
				onClick:function(){
					var treeObj = $.fn.zTree.getZTreeObj("permission_tree");
					var nodes = treeObj.getSelectedNodes();
					parent.workareaFrame.location = "${pageContext.request.contextPath}/permissionController/getPermission?id="+nodes[0].id;
				}
			},
			async: {
				enable: true,
				url: "${pageContext.request.contextPath}/permissionController/getPermissionList",
				autoParam: ["id", "name"]
			}
		};

		/*var zNodes =[
			{id:"1",pId:"0",name:"ERP后台管理",open:true},
			{id:"11",pId:"1",name:"操作员管理",open:true},
			{id:"111",pId:"11",name:"权限管理",open:true},
			{id:"1111",pId:"111",name:"许可维护",open:true},
			{id:"11111",pId:"1111",name:"新增许可"},
			{id:"11112",pId:"1111",name:"修改许可"},
			{id:"11113",pId:"1111",name:"删除许可"},
			{id:"1112",pId:"111",name:"角色维护",open:true},
			{id:"11121",pId:"1112",name:"新增角色"},
			{id:"11122",pId:"1112",name:"修改角色"},
			{id:"11123",pId:"1112",name:"删除角色"},
			{id:"1113",pId:"111",name:"用户维护",open:true},
			{id:"11131",pId:"1113",name:"新增用户"},
			{id:"11132",pId:"1113",name:"修改用户"},
			{id:"11133",pId:"1113",name:"删除用户"},
		];*/
			$(document).ready(function(){
				$.fn.zTree.init($("#permission_tree"), setting);
			});
		</script>
<ul id="permission_tree" class="ztree">
</ul>
